﻿//-----------------------------------------------------------------------
// <copyright file="ChangeSetCollection.cs" company="FastNET Services">
//     Copyright (c) 2008-2009. All Rights Reserved.
// </copyright>
// <license>
//     GPLv2
// </license>
// <warranty>
//     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
//     BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
//     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
//     DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//     OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// </warranty>
//-----------------------------------------------------------------------
#region Usings
using System;
using System.Collections;
using System.ComponentModel;
#endregion

namespace GateShift.Tools.DatabaseMigration.Configuration
{
    /// <summary>
    /// Collection for ChangeSet
    /// </summary>
    [Serializable]
    [EditorBrowsable(EditorBrowsableState.Advanced)]
    public class ChangeSetCollection : ArrayList
    {
        /// <summary>
        /// Gets or sets a strongly typed ChangeSet from the collection of items
        /// </summary>
        /// <param name="index">Zero based index to retrieve</param>
        /// <returns>ChangeSet from the specified index</returns>
        public new ChangeSet this[int index]
        {
            get
            {
                return (ChangeSet)base[index];
            }

            set
            {
                base[index] = value;
            }
        }

        /// <summary>
        /// Adds a new ChangeSet to the list and returns the instance
        /// </summary>
        /// <param name="item">ChangeSet to add</param>
        /// <returns>ChangeSet that was added</returns>
        public ChangeSet Add(ChangeSet item)
        {
            base.Add(item);
            return item;
        }

        /// <summary>
        /// Adds a new ChangeSet and returns the instance
        /// </summary>
        /// <returns>ChangeSet that was added</returns>
        public ChangeSet Add()
        {
            return Add(new ChangeSet());
        }

        /// <summary>
        /// Injects an instance of ChangeSet into the collection of ChangeSet
        /// </summary>
        /// <param name="index">Zero based index to insert the item at</param>
        /// <param name="item">ChangeSet to add</param>
        public void Insert(int index, ChangeSet item)
        {
            base.Insert(index, item);
        }

        /// <summary>
        /// Removes the specified instance of ChangeSet from the collection
        /// </summary>
        /// <param name="item">ChangeSet to remove</param>
        public void Remove(ChangeSet item)
        {
            base.Remove(item);
        }
    }
}
